import tensorflow as tf
import time

X = tf.Variable([[6, 6, 3], [6, 6, 6]], dtype=tf.float32);

min_0 = tf.reduce_min(X, axis=0)
min_1 = tf.reduce_min(X, axis=1)
min_0_1 = tf.reduce_min(X, axis=[0, 1])
min_1_0 = tf.reduce_min(X, axis=[1, 0])

d_min_0 = tf.gradients(min_0, X)
d_min_1 = tf.gradients(min_1, X)
d_min_0_1 = tf.gradients(min_0_1, X)
d_min_1_0 = tf.gradients(min_1_0, X)

with tf.Session() as sess:
    sess.run(tf.global_variables_initializer())
    
    print('------min_0------')
    print(sess.run(min_0))
    print('------min_1------')
    print(sess.run(min_1))
    print('------min_0_1------')
    print(sess.run(min_0_1))
    print('------min_1_0------')
    print(sess.run(min_1_0))
    
    print('------d_min_0------')
    print(sess.run(d_min_0))
    print('------d_min_1------')
    print(sess.run(d_min_1))
    print('------d_min_0_1------')
    print(sess.run(d_min_0_1))
    print('------d_min_1_0------')
    print(sess.run(d_min_1_0))